package com.lx.composetest.glpaint

import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.util.AttributeSet
import android.view.MotionEvent
import com.chillingvan.canvasgl.ICanvasGL
import com.chillingvan.canvasgl.glcanvas.GLPaint
import com.chillingvan.canvasgl.glview.GLView

/**
 *  desc : TODO Fill the fucking desc
 *
 *
 *  @author LuXin
 *  @createTime 2024/7/31
 */
class MyGLView : GLView {
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)

    val paint = GLPaint().apply {
        this.color = Color.RED
        this.lineWidth = 10f
        this.style = Paint.Style.STROKE
    }

    override fun onGLDraw(canvas: ICanvasGL?) {
        canvas?.drawLine(0f, 0f, 1000f, 1000f, paint)
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        return super.onTouchEvent(event)

    }

}